<table border="0" cellpadding="4" cellspacing="1" align="center" class="mainTable">
    <tr>
        <th width="40">ID</th>
        <th>用户名</th>
        <?php 
        if ($is_super)
        {
        ?>
        <th>所属项目</th>
        <?php 
        }
        ?>
        <th>管理组</th>
        <th width="140">最后登录时间</th>
        <th width="110">最后登录IP</th>
        <th width="40">登录数</th>
        <th width="30">屏蔽</th>
        <th width="180">操作</th>
    </tr>
    <?php 
    $member_id = Session::instance()->member()->id;
    if ($list)foreach ($list as $item)
    {
        if (false)$item = new Member();
    ?>
    <tr align="center">
        <td class="td1"><?php echo $item->id;?></td>
        <td class="td2"><?php echo $item->username;if ($item->nickname)echo ' ('.$item->nickname.')';?></td>
        <?php 
        if ($is_super)
        {
        ?>
        <td class="td2"><?php echo Core::config('core.projects.'.$item->project.'.name');?></td>
        <?php 
        }
        ?>
        <td class="td2">
        <?php 
        if (count($item->group_ids)==0)
        {
            echo '&nbsp;';
        }
        elseif (count($item->group_ids)>1)
        {
            $group_html = array();
            #多个组
            foreach ($item->all_groups() as $v)
            {
                $group_html[] = '<a href="'.Core::url('administrator/group/edit/'.$v->id).'">'.$v->group_name.'</a>';
            }
            echo implode(' | ', $group_html);
        }
        else
        {
            # 单个组
            echo '<a href="'.Core::url('administrator/group/edit/'.$item->default_group_id).'">'.$item->default_group->group_name.'</a>';
        }
        ?>
        </td>
        <td class="td2"><?php echo $item->last_login_time>0?date('Y-m-d H:i:s',$item->last_login_time):'未登录';?></td>
        <td class="td2"><?php echo $item->last_login_ip;?></td>
        <td class="td2"><?php echo $item->login_num;?></td>
        <td class="td2"><?php echo $item->shielded?'<font style="color:red">是</font>':'<font style="color:green">否</font>';?></td>
        <td class="td2">
        <input type="button" value="改设置" onclick="goto('<?php echo Core::url('administrator/edit/'.$item->id);?>')" />
        <input type="button" value="改密码" onclick="goto('<?php echo Core::url('administrator/change_password/'.$item->id);?>')" />
        <?php 
        if ($item->shielded)
        {
        ?>
        <input type="button" value="解" title="解除对用户的屏蔽" onclick="MyQEE.ask_todo('<?php echo Core::url('administrator/liftshield/'.$item->id);?>','您确认要解除对此用户的屏蔽？')" />
        <?php 
        }
        else 
        {
        ?>
        <input type="button" value="屏" <?php echo $item->id==$member_id?' disabled="disabled"':'';?> title="屏蔽用户登录" onclick="MyQEE.ask_todo('<?php echo Core::url('administrator/shield/'.$item->id);?>','您确认要屏蔽此用户？')" />
        <?php 
        }
        ?>
        <input type="button" value="删" <?php echo $item->id==$member_id?' disabled="disabled"':'';?> onclick="MyQEE.ask_todo('<?php echo Core::url('administrator/delete/'.$item->id);?>','您确认要删除此用户？')" />
        </td>
    </tr>
    <?php 
    }
    ?>
    <tr>
        <td class="td1" colspan="<?php echo $is_super?8:7;?>"> </td>
        <td class="td1" align="center">
        <input type="button" class="submit" value="创建新用户" onclick="goto('<?php echo Core::url('administrator/add');?>')" />
        </td>
    </tr>
</table>

<center>
<?php echo $pagehtml;?>
</center>